package com.lch.designpattern.proxy.dynamicproxy.gpproxy;

import com.lch.designpattern.proxy.Person;
import com.lch.designpattern.proxy.dynamicproxy.jdkproxy.Girl;
import com.lch.designpattern.proxy.staticproxy.Son;

/**
 * 测试自己写的动态代理类实现
 *
 * @author: liuchenhui
 * @create: 2019-04-20 12:40
 **/
public class GPProxyTest {
    public static void main(String[] args) {
        try {
            // JDK动态代理的实现原理
            Person person = (Person) new GPemcee().getInstance(new Girl());
            Person son = new Son();
            person.marryTo(son);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
